package cn.jobstart.controller;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.web.bind.annotation.RestController;
import cn.jobstart.pubInter.exception.SkException;
import cn.jobstart.pubInter.IBaseService;
import cn.jobstart.pubInter.RestfulController;
import cn.jobstart.dto.PersonRemarkDTO;
import cn.jobstart.dto.PersonRemarkPageDTO;
import cn.jobstart.modelExt.PersonRemarkExt;
import cn.jobstart.searchExt.PersonRemarkSearchExt;
import cn.jobstart.service.IPersonRemarkService;
import cn.jobstart.vo.PersonRemarkDetailVO;
import cn.jobstart.vo.PersonRemarkListVO;
import cn.jobstart.vo.PersonRemarkDomainVO;
import cn.jobstart.vo.PersonRemarkDetailDomainVO;
import cn.jobstart.export.PersonRemarkDomainExport;
import cn.jobstart.controller.ApiManageController;
import org.springframework.validation.annotation.Validated;
import java.util.Set;
import java.util.HashSet;
import cn.jobstart.pubInter.exception.BusinessException;

/**
*    @author sunke
*    @Date 2023-09-13 22:44:20
*    @description PersonRemarkController      人才备注
*/
@Api(tags = "人才库管理系统-人才备注相关", description = "人才备注相关接口")
@RestController(value ="personRemarkRestfulController")
@RequestMapping("/personRemark/")
@Validated
public class PersonRemarkController extends ApiManageController<PersonRemarkDTO,PersonRemarkPageDTO,PersonRemarkExt, PersonRemarkSearchExt,PersonRemarkDomainVO,PersonRemarkDetailDomainVO,PersonRemarkDetailVO,PersonRemarkListVO,String> {

	@Resource(name = "personRemarkService")
	private IPersonRemarkService personRemarkService;


	@Override
	public boolean beforePostAdd(PersonRemarkDTO dto, PersonRemarkExt domain, HttpServletRequest request, HttpSession session) throws SkException {

		domain.setAdminId(getJwtsUtil().getAdminId(request));
		domain.setAdminTruename(getJwtsUtil().getAdminTruename(request));
		return super.beforePostAdd(dto, domain, request, session);
	}

	@Override
	public IBaseService<PersonRemarkExt, PersonRemarkSearchExt,String> getBaseService() throws SkException {
		return personRemarkService;
	}

	@Override
	public String getBaseRoute() {
		return "/personRemark/";
	}

	/**
	* 当前模板名称
	* @return
	*/
	@Override
	public String getModelName(){
		return "人才备注";
	}

	@Override
	public Class exportExcelClass() {
		return PersonRemarkDomainExport.class;
	}

	@Override
	public Set<String> totalMapSet() {
		Set totalMapSet=new HashSet();
		totalMapSet.add("count(person_remark.pr_id) as countNum");
		return totalMapSet;
	}


}